(function(){
  function boot(){
    if(window.RTAccount && document.querySelector('#rt-invoice-root') && document.querySelector('#rt-license-root')){
      if(window.__rtacc_boot__) return; window.__rtacc_boot__=true;
      RTAccount.initInvoice('#rt-invoice-root', { invoiceUrl:'invoice.html' });
      RTAccount.initLicense('#rt-license-root', { certificateUrl:'certificate.html' });
    }else{ setTimeout(boot, 60); }
  }
  if(document.readyState==='loading'){ document.addEventListener('DOMContentLoaded', boot); } else { boot(); }
})();